import request from '@/utils/request'

// 查询农户列表
export function listFarmers(query) {
  return request({
    url: '/assisting/farmers/list',
    method: 'get',
    params: query
  })
}

// 查询农户详细
export function getFarmers(farmersId) {
  return request({
    url: '/assisting/farmers/' + farmersId,
    method: 'get'
  })
}

// 新增农户
export function addFarmers(data) {
  return request({
    url: '/assisting/farmers',
    method: 'post',
    data: data
  })
}

// 修改农户
export function updateFarmers(data) {
  return request({
    url: '/assisting/farmers',
    method: 'put',
    data: data
  })
}

// 删除农户
export function delFarmers(farmersId) {
  return request({
    url: '/assisting/farmers/' + farmersId,
    method: 'delete'
  })
}

    /*
     * 查询用户的农户认证信息
     * 返回 审核状态 + 拒绝理由
     */
export function getAuthStatusInfo() {
  return request({
    url: '/assisting/farmers/getAuthStatusInfo',
    method: 'get'
  })
}

// 重新认证按钮 更新拒绝状态
export function updateAuthRejectInfo(data) {
  return request({
    url: '/assisting/farmers/updateAuthRejectInfo',
    method: 'put',
    data: data
  })
}

